<%@ Page Language="VB" MasterPageFile="~/Provider/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Provider_Backup_Default" title="Untitled Page" StylesheetTheme="Granite" %>
<asp:Content ID="Content1" ContentPlaceHolderID="mainCopy" Runat="Server">
<table>
            <tr>
                <td>
                    <asp:Label ID="lblFrom" runat="server" Text="Desde:"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtFrom" runat="server" Width="113px"></asp:TextBox></td>
                <td>
                    <asp:Label ID="lblTo" runat="server" Text="Hasta:"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtTo" runat="server" Width="113px"></asp:TextBox></td>
                <td>
                </td>
            </tr>
    <tr>
        <td>
            <asp:Label ID="lblUser" runat="server" Text="Usuario:"></asp:Label></td>
        <td>
            <asp:DropDownList ID="ddlUser" runat="server" AppendDataBoundItems="True" DataSourceID="dsUsers"
                DataTextField="UserName" DataValueField="UserId">
                <asp:ListItem Selected="True" Value="00000000-0000-0000-0000-000000000000">*</asp:ListItem>
            </asp:DropDownList></td>
        <td>
            <asp:Label ID="lblTenant" runat="server" Text="Tenant:"></asp:Label></td>
        <td>
            <asp:DropDownList ID="ddlTenant" runat="server" AppendDataBoundItems="True" DataSourceID="dsTenant"
                DataTextField="TenantName" DataValueField="TenantId">
                <asp:ListItem Selected="True" Value="00000000-0000-0000-0000-000000000000">*</asp:ListItem>
            </asp:DropDownList></td>
        <td>
            <asp:Button ID="btnBuscar" runat="server" Text="Buscar" /></td>
    </tr>
        </table>
    <asp:GridView ID="grdBackups" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="dsBackups">
        <Columns>
            <asp:CommandField SelectText="Restaurar" ShowSelectButton="True" />
            <asp:BoundField DataField="Date" HeaderText="Fecha" />
            <asp:BoundField DataField="UserName" HeaderText="Usuario" />
            <asp:BoundField DataField="TenantName" HeaderText="Tenant" />
            <asp:BoundField DataField="BackupKind" HeaderText="Tipo" />
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="dsBackups" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="ListWithFilters" TypeName="Security.Data.BackupViewDAO">
        <SelectParameters>
            <asp:ControlParameter Name="userId" ControlID="ddlUser" PropertyName="SelectedValue" DefaultValue="00000000-0000-0000-0000-000000000000" />
            <asp:ControlParameter Name="tenantId" ControlID="ddlTenant" PropertyName="SelectedValue" DefaultValue="00000000-0000-0000-0000-000000000000" />
            <asp:ControlParameter Name="fromDate" ControlID="txtFrom" PropertyName="Text" DefaultValue="" />
            <asp:ControlParameter Name="toDate" ControlID="txtTo" PropertyName="Text" DefaultValue="" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <br />
    <asp:Button ID="btnBackup" runat="server" Text="Crear Backup" /><br />
    <asp:ObjectDataSource ID="dsTenant" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="ListAll" TypeName="Security.Data.TenantDAO"></asp:ObjectDataSource>
    <asp:ObjectDataSource ID="dsUsers" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="ListAll" TypeName="Security.Data.UserDAO"></asp:ObjectDataSource>
    <asp:ScriptManagerProxy id="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" Format="dd/MM/yyyy"
        TargetControlID="txtFrom">
    </ajaxToolkit:CalendarExtender>
    <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" Format="dd/MM/yyyy"
        TargetControlID="txtTo">
    </ajaxToolkit:CalendarExtender>
</asp:Content>